
#ifndef GPS_PROTO_TCX_PARSER_H__
#define GPS_PROTO_TCX_PARSER_H__

#include <string>
#include "gps_parser.h"

namespace gps_proto {

class GpsProto;
class TrackProto;
class SegmentProto;
class PointProto;

// <TrainingCenterDatabase>
//   <Activities>
//     <Activity Sport="Biking">
//       <Track>
//         <Trackpoint>
//           <Time>2009-08-27T05:34:05Z</Time>
//           <Position>
//             <LatitudeDegrees>47.4448948</LatitudeDegrees>
//             <LongitudeDegrees>-122.2965579</LongitudeDegrees>
//           </Position>
//           <AltitudeMeters>134.7219238</AltitudeMeters>
//           <DistanceMeters>0.0000000</DistanceMeters>
//           <SensorState>Absent</SensorState>
//         </Trackpoint>
//       </Track>
//     </Activity>
//   </Activities>
// </TrainingCenterDatabase>
class TcxParser : public GpsParser {
 public:
  TcxParser(GpsProto* gps_proto);

  static bool ParseFromFile(const char* filename, GpsProto* gpx_proto);
  static bool ParseFromIstream(std::istream* input, GpsProto* gpx_proto);
  static bool ParseFromString(const std::string& gpx, GpsProto* gpx_proto);

  // ExpatHandler::StartElement()
  virtual void StartElement(const char *name, const char **atts);

  // ExpatHandler::EndElement()
  virtual void EndElement(const char *name);
};

}  // end namespace gps_proto

#endif  // GPS_PROTO_TCX_PARSER_H__
